package com.jlkf.controller;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import com.jlkf.service.TblCourseLikeService;
import com.platform.server.response.response.pojo.ReturnData;

@Controller
@RequestMapping(value="courseLike")
public class TblCourseLikeController {

	// 用户课程收藏信息
	@Autowired
	private TblCourseLikeService tblCourseLikeService;
	
	/**
	 *  用户收藏课程
	 * @param courseId
	 * @param userId
	 * @return
	 */
	 @RequestMapping(value="coursePraise")
	 @ResponseBody
     public ReturnData coursePraise(Long userId,Long courseId,Integer type,Long id){
    	 
		return tblCourseLikeService.coursePraise(userId,courseId,type,id);
     } 
	
	 /**
	 *  取消点赞
	 * @param id
	 * @return
	 */
	 @ResponseBody
     @RequestMapping(value="cancelCourseLike")
     public ReturnData cancelCourseLike(Long courseId, Long userId){
    	 
		return tblCourseLikeService.cancelCourseLike(courseId,userId);
     }
	
	/**
	 *  用户收藏列表
	 * @param userId
	 * @return
	 */
	 @ResponseBody
     @RequestMapping(value="courseLikeList")
     public ReturnData  courseLikeList(Long userId,Integer pageSize,Integer pageNumber){
    	 
		return tblCourseLikeService.courseLikeList(userId,pageSize,pageNumber);
     }
     
     /**
      *  用户点赞课程
      * @param userId
      * @param courseId
      * @return
      */
	 @ResponseBody
     @RequestMapping(value="likeCourse")
	 public ReturnData  likeCourse(Long courseId,Long userId){
		   return tblCourseLikeService.likeCourse(courseId,userId);
	 }     
}
